function Shipper(jsonObject) {
	this.internalObject = jsonObject;
}

Shipper.prototype = {
	getCompanyName: function() { return this.internalObject.CompanyName; },
	setCompanyName: function(companyname) { this.internalObject.CompanyName = companyname; },
	getPhone: function() { return this.internalObject.Phone; },
	setPhone: function(phone) { this.internalObject.Phone = phone; },
	getShipperId: function() { return this.internalObject.ShipperId; },
	getCreatedDate: function() { return this.internalObject.CreatedDate; },
	getCreatedBy: function() { return this.internalObject.CreatedBy; },
	getModifiedDate: function() { return this.internalObject.ModifiedDate; },
	getModifiedBy: function() { return this.internalObject.ModifiedBy; },
	getShipperObject: function() { return this.internalObject; }
};

function ShipperService() {
}

ShipperService.prototype.retrieveAll = function(successCallback) {
    viewServiceProxy.invokeGet("ShipperList", successCallback, OnPageError, true);
};

ShipperService.prototype.retrievePaged = function(successCallback, pageIndex, pageSize, sortOrder, sortColumn, linq) {
    var restUrl = "ShipperListPage";
    restUrl = restUrl + "/?";

    if (!IsNullOrEmpty(pageIndex)) {
        restUrl = restUrl + "pageIndex=" + pageIndex;
        if (!IsNullOrEmpty(pageSize) || !IsNullOrEmpty(sortOrder) || !IsNullOrEmpty(sortColumn) || !IsNullOrEmpty(linq)) {
            restUrl = restUrl + "&";
        }
    }
    if (!IsNullOrEmpty(pageSize)) {
        restUrl = restUrl + "pageSize=" + pageSize;
        if (!IsNullOrEmpty(sortOrder) || !IsNullOrEmpty(sortColumn) || !IsNullOrEmpty(linq)) {
            restUrl = restUrl + "&";
        }
    }
    if (!IsNullOrEmpty(sortOrder)) {
        restUrl = restUrl + "sortOrder=" + sortOrder;
        if (!IsNullOrEmpty(sortColumn) || !IsNullOrEmpty(linq)) {
            restUrl = restUrl + "&";
        }
    }
    if (!IsNullOrEmpty(sortColumn)) {
        restUrl = restUrl + "sortColumn=" + sortColumn;
        if (!IsNullOrEmpty(linq)) {
            restUrl = restUrl + "&";
        }
    }
    restUrl = restUrl + "linq=" + linq;

    viewServiceProxy.invokeGet(restUrl, successCallback, OnPageError, true);
};

ShipperService.prototype.save = function(shipper, successCallback) {
viewServiceProxy.invokePut("Shipper", shipper.getShipperObject(), successCallback, OnPageError, true);
};
